﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using documentRdr.Properties;

namespace documentRdr
{
    public partial class ResultForm  : Form
    {
        public ResultForm(Func<object> getDataSource)
        {
            InitializeComponent();

            Load += (s, a) =>
                        {
                            try
                            {
                                dataGridView1.DataSource = getDataSource();
                            }
                            catch (Exception exception)
                            {
                                MessageBox.Show(exception.Message, Resources.ErrorWIndowCaption, MessageBoxButtons.OK,
                                                MessageBoxIcon.Error);
                            }
                        };

        }
    }
}
